Stacks are often used in computer programs to keep track of information about routines that the computer program may execute. Such information may include a return address to mark the point where the active subroutine should return control when the subroutine finishes executing. Thus, when a function executes, the computer program may add some of the function's state data to the top of the stack for later retrieval. When the function completes its task, the computer program may remove the state data from the top of the stack and use that data to return the program to the correct executing point. By removing, or “popping”, the return information off of the stack, the computer program may know where to return control once the subroutine is completed.
In most multithreaded computing systems, each thread may incorporate a stack to maintain information about the application running on the threads. Maintaining stacks for each thread may prevent multiple threads from accessing a application at one time, thereby possibly creating a conflict within the application. Thus, each thread may maintain information about the applications running on the threads as a check to maintain the integrity of each executing application.
As more and more subroutines of a computer program are processed on the threads of a multithreaded computing system, the information stored in a given stack may grow very large. Applications running on any given thread may ultimately call methods from several other applications, creating a long chain of information stored on a stack. However, in a resource constrained computer environment, available memory space is often very limited. Thus, stacks storing large amounts of information may unduly consume much of the valuable memory space of the computing environment.